package org.hxzon.project;

import java.util.Collection;
import java.util.List;

public interface ModelService<M> {
    void add(M model);

    void addAll(Collection<M> models);

    void update(M model);

    void updateAll(Collection<M> models);

    void save(M model);

    void saveAll(Collection<M> models);

    void delete(String id);

    void delete(long id);

    void delete(M model);

    void deleteAll();

    void deleteAll(Collection<M> models);

    M findById(String id);

    M findById(long id);

    List<M> findAll();

    List<M> findAll(long first, long size);

    List<M> findLikeByExample(M model, long first, long size);

    List<M> findLike(String like, long first, long size);

    long countAll();

    long countLikeByExample(M model);

    long countLike(String like);

    String valid(M model);

    List<M> search(String search, long first, long size);

    long countSearch(String search);
}
